#ifndef GAMESTATE_DATASTORAGE_H
#define GAMESTATE_DATASTORAGE_H


#include <map>
#include <string>

namespace GameState {

// data storage
template<typename T>
class DataStorage {
  private:
	static std::map<std::string, T> dataMap; 

  public:
	static void set(std::string key, T data); 
	static const T & get(std::string key); 
};
template<typename T>
std::map<std::string, T> DataStorage<T>::dataMap; 
template<typename T>
void DataStorage<T>::set(std::string key, T data)
{
	DataStorage<T>::dataMap[key] = data;
}

template<typename T>
const T & DataStorage<T>::get(std::string key)
{
	return DataStorage<T>::dataMap[key];
}


} // namespace GameState
#endif
